//下面是模板库
import request from '@/utils/request'
import {
  parseStrEmpty
} from "@/utils/ruoyi";
//新增模板类型
export function insertType(query) {
  return request({
    url: '/system/template/type/',
    // url: '/system/template/insertType/?name=' + query,
    method: 'post',
    data: query
  })
}
//新增模板
export function insertTemplate(query) {
  return request({
    url: '/system/template/insertTemplate',
    method: 'post',
    data: query
  })
}
//模板列表
export function list(query) {
  return request({
    url: '/system/template/list',
    method: 'get',
    params: query
  })
}
//模板类型
export function listType(query) {
  return request({
    url: '/system/template/type/list',
    method: 'get',
    params: query
  })
}
//模板删除类型
export function deleteTemplate(query) {
  return request({
    url: '/system/template/type/batchDelete',
    method: 'post',
    data: query
  })
}
export function deleteTemplateItem(query) {
  return request({
    url: '/system/template/batchDelete',
    method: 'post',
    data: query
  })
}
export function updateTemplate(query) {
  return request({
    url: '/system/template/type',
    method: 'put',
    data: query
  })
}
export function search(query) {
  return request({
    url: '/system/template/search',
    method: 'post',
    data: query
  })
}
export function searchType(query) {
  return request({
    url: '/system/template/type',
    method: 'get',
    params: query
  })
}
// 查询用户详细
// export function getUser(query) {
//   return request({
//     url: '/system/user/list',
//     method: 'get',
//     params: query
//   })
// }
// 查询模板详情详细
export function getTemplates(query) {
  return request({
    url: '/system/template/' + query.templateId,
    method: 'get',
    // params: query
  })
}
// 保存素材到模板
export function saveMaterial(query) {
  return request({
    url: '/system/template/save/material',
    method: 'post',
    data: query
  })
}
export function saveWord(query) {
  return request({
    url: '/system/template/word',
    method: 'post',
    data: query,
    responseType: "blob"
  })
}
export function myList(query) {
  return request({
    url: '/system/template/my/list',
    method: 'get',
    params: query
  })
}
export function materialSearch(query) {
  return request({
    url: 'system/material/search',
    method: 'post',
    data: query
  })
}
// 查询用户详细
export function getUser(query) {
  return request({
    url: '/system/template/user/list',
    method: 'get',
    // params: query
  })
}
